home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / codeprnt / readfr / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1994-12-15  |  6.3 KB  |  216 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "ReadForms"
  5.    ClientHeight    =   4365
  6.    ClientLeft      =   3720
  7.    ClientTop       =   2235
  8.    ClientWidth     =   5625
  9.    Height          =   5055
  10.    Icon            =   FORM1.FRX:0000
  11.    Left            =   3660
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   4365
  15.    ScaleWidth      =   5625
  16.    Top             =   1605
  17.    Width           =   5745
  18.    Begin Frame Frame1 
  19.       BackColor       =   &H00C0C0C0&
  20.       Caption         =   "Send output to:"
  21.       ForeColor       =   &H00FF0000&
  22.       Height          =   1095
  23.       Left            =   2880
  24.       TabIndex        =   6
  25.       Top             =   1320
  26.       Width           =   2535
  27.       Begin SSOption Option3D2 
  28.          Caption         =   "Word for Windows"
  29.          Height          =   255
  30.          Left            =   240
  31.          TabIndex        =   8
  32.          TabStop         =   0   'False
  33.          Top             =   720
  34.          Width           =   1815
  35.       End
  36.       Begin SSOption Option3D1 
  37.          Caption         =   "Windows 'Write'"
  38.          Height          =   255
  39.          Left            =   240
  40.          TabIndex        =   7
  41.          Top             =   360
  42.          Value           =   -1  'True
  43.          Width           =   1935
  44.       End
  45.    End
  46.    Begin DirListBox Dir1 
  47.       Height          =   2730
  48.       Left            =   240
  49.       TabIndex        =   3
  50.       Top             =   1320
  51.       Width           =   2175
  52.    End
  53.    Begin DriveListBox Drive1 
  54.       Height          =   315
  55.       Left            =   240
  56.       TabIndex        =   2
  57.       Top             =   960
  58.       Width           =   2175
  59.    End
  60.    Begin CommandButton Command3 
  61.       BackColor       =   &H00C0C0C0&
  62.       Caption         =   "Exit"
  63.       Height          =   495
  64.       Left            =   3720
  65.       TabIndex        =   1
  66.       Top             =   3720
  67.       Width           =   1695
  68.    End
  69.    Begin Timer Timer1 
  70.       Enabled         =   0   'False
  71.       Interval        =   2000
  72.       Left            =   3000
  73.       Top             =   3960
  74.    End
  75.    Begin CommandButton Command2 
  76.       BackColor       =   &H00C0C0C0&
  77.       Caption         =   "Get .FRM Files"
  78.       Height          =   615
  79.       Left            =   3720
  80.       TabIndex        =   0
  81.       Top             =   3000
  82.       Width           =   1695
  83.    End
  84.    Begin Timer Timer2 
  85.       Enabled         =   0   'False
  86.       Interval        =   2000
  87.       Left            =   2520
  88.       Top             =   3960
  89.    End
  90.    Begin Label Label2 
  91.       BackColor       =   &H00C0C0C0&
  92.       Caption         =   "Selected directory:"
  93.       FontBold        =   -1  'True
  94.       FontItalic      =   0   'False
  95.       FontName        =   "MS Sans Serif"
  96.       FontSize        =   9.75
  97.       FontStrikethru  =   0   'False
  98.       FontUnderline   =   0   'False
  99.       ForeColor       =   &H00FF0000&
  100.       Height          =   255
  101.       Left            =   240
  102.       TabIndex        =   5
  103.       Top             =   120
  104.       Width           =   2415
  105.    End
  106.    Begin Label Label1 
  107.       BackColor       =   &H00C0C0C0&
  108.       BorderStyle     =   1  'Fixed Single
  109.       FontBold        =   -1  'True
  110.       FontItalic      =   0   'False
  111.       FontName        =   "MS Sans Serif"
  112.       FontSize        =   9.75
  113.       FontStrikethru  =   0   'False
  114.       FontUnderline   =   0   'False
  115.       ForeColor       =   &H000000C0&
  116.       Height          =   255
  117.       Left            =   240
  118.       TabIndex        =   4
  119.       Top             =   480
  120.       Width           =   5175
  121.    End
  122.    Begin Menu help 
  123.       Caption         =   "&Help"
  124.       Begin Menu what 
  125.          Caption         =   "&What it does"
  126.       End
  127.       Begin Menu about 
  128.          Caption         =   "&About"
  129.       End
  130.    End
  131. Sub about_Click ()
  132. form3.Show
  133. End Sub
  134. Sub Command2_Click ()
  135. screen.MousePointer = 11
  136. 'build a batch file containing the path of the files to be read....
  137. Open "c:\readfrms.bat" For Output As #1
  138. Print #1, Left$(Dir1.Path, 1) & ":"
  139. len1 = Len(Dir1.Path) - 3
  140. Print #1, "cd\" & Right$(Dir1.Path, len1)
  141. Print #1, "dir *.frm /s /b > c:\readfrms.wrk"
  142. Print #1, "del c:\control.xxx"
  143. Print #1, "del c:\readfrms.bat"
  144. Close #1
  145. 'wait a couple of seconds for the batch file to be written....
  146. timer2.Enabled = True
  147. End Sub
  148. Sub Command3_Click ()
  149. End Sub
  150. Sub Dir1_Change ()
  151. Label1.Caption = Dir1.Path
  152. End Sub
  153. Sub Drive1_Change ()
  154. Dir1.Path = Drive1.Drive
  155. End Sub
  156. Sub Form_Activate ()
  157. screen.MousePointer = 0
  158. End Sub
  159. Sub Form_Load ()
  160. screen.MousePointer = 11
  161. newpath = app.Path
  162. If Right$(newpath, 1) = "\" Then newpath = Left$(newpath, (Len(newpath) - 1))
  163. form1.Drive1.Drive = "c:\"
  164. form1.Dir1.Path = "c:\"
  165. form1.Label1.Caption = Dir1.Path
  166. Left = (screen.Width - Width) / 2
  167. Top = (screen.Height - Height) / 6
  168. End Sub
  169. Sub Timer1_Timer ()
  170. dirtext = Dir$("c:\control.xxx")
  171. 'Check to see if CONTROL.XXX has been deleted yet....
  172. If dirtext = "" Then
  173.     timer1.Enabled = False
  174.     Open newpath & "\temp.tmp" For Output As #3
  175.     Open "c:\readfrms.wrk" For Input As #1
  176.     Do Until EOF(1)
  177.         Line Input #1, fileline
  178.         Open fileline For Input As #2
  179.         Do Until EOF(2)
  180.             Line Input #2, lines
  181.             If Left$(lines, 4) = "Sub " Then
  182.                 Print #3, "***************** " & fileline & " *****************"
  183.                 Print #3, lines
  184.                 
  185.                 Do Until EOF(2)
  186.                     Line Input #2, lines
  187.                     Print #3, lines
  188.                 Loop
  189.             End If
  190.         Loop
  191.         Close #2
  192.     Loop
  193.     Close
  194.     screen.MousePointer = 0
  195.     Kill "c:\readfrms.wrk"
  196.     screen.MousePointer = 0
  197.     If form1.Option3D2.Value = True Then
  198.         x = Shell("c:\winword6\winword.exe " & newpath & "\temp.tmp", 3)
  199.         Else x = Shell("write.exe " & newpath & "\temp.tmp", 3)
  200.     End If
  201.     End
  202. End If
  203. End Sub
  204. Sub Timer2_Timer ()
  205. timer2.Enabled = False
  206. screen.MousePointer = 11
  207. timer1.Enabled = True
  208. 'create a temp file that gets deleted after READFRMS.WRK has finished....
  209. Open "c:\control.xxx" For Output As #1
  210. Close #1
  211. x = Shell(newpath & "\readfrms.pif")
  212. End Sub
  213. Sub what_Click ()
  214. form2.Show
  215. End Sub
  216.